package com.blast.comicsisland.model.rank.rankbody;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by dell on 2015/6/24.
 */
public class Info {
    private List<Special> specials;

    public List<Special> getSpecials() {
        return specials;
    }

    public void setSpecials(List<Special> specials) {
        this.specials = specials;
    }

    public void jsonParse(JSONObject jsonObject){
        specials = new LinkedList<Special>();
        try {
            JSONArray jsonArray = jsonObject.getJSONArray("specials");
            for (int i = 0; i < jsonArray.length(); i++) {
                Special special = new Special();
                JSONObject object = jsonArray.getJSONObject(i);
                special.jsonParse(object);
                specials.add(special);
            }


        } catch (JSONException e) {
            e.printStackTrace();
        }

    }

}
